package com.study.demo_security_acl.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Name: HelloController
 * @Description: java类作用描述
 * @Author: yn
 * @CreateDate: 2022/6/27 15:33
 * @Remark: 特殊说明
 * @Version: 1.0
 */
@RestController
public class HelloController {
    @GetMapping("/gettrue")
    @PreAuthorize("@acl.check(AuthUtil.get(false))")
    public String gettrue() {
        return "gettrue";
    }

    @GetMapping("/getfalse")
    @PreAuthorize("@acl.check('1')")
    public String getfalse() {
        return "getfalse";
    }

    @GetMapping("/get")
    @PreAuthorize("hasPermission()")
    public String get() {
        return "getfalse";
    }
}
